#!/bin/bash
function log_java() {
	args=$@
	echo "java -classpath ./repository.jar:lib/log4j-1.2.15.jar $args &"
	java -classpath ./repository.jar:lib/log4j-1.2.15.jar $args &
}
function log_ssh() {
	args=$@
	echo "ssh $args"
	ssh $args
}
function log_rsync() {
	args=$@
	echo "rsync -av --exclude '.svn' $args"
	rsync -av --exclude ".svn" $args
}

if [ $# -ne 2 ]; then
	echo "./run.sh ReposSocketServer port"
	echo "./run.sh ReposSocketClient count"
else
	target=$1
	if [ "$target" == "ReposSocketServer" ]; then
	    port=$2
		log_java com.oromwin.repos.socket.$main $port
	elif [ "$target" == "ReposSocketClient" ]; then
        count=$2
		log_java com.oromwin.repos.spike.$main $count
	fi
fi
